package com.javafactroy.kunlong.data.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import com.javafactroy.kunlong.client.feign.dto.PageInfoDto;

import javax.persistence.Column;
import javax.persistence.*;
import java.util.Date;
//import javax.persistence.Id;
import java.math.BigDecimal;

import lombok.experimental.Accessors;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import com.alibaba.excel.annotation.write.style.ColumnWidth;

import io.swagger.annotations.ApiModelProperty;

/**
 * @author raymond.lei@163.com
 * @date 2023-11-13 21:22:50
 * @file CouponApiEntity.java
 * @company farben.sz.com
 */
@Data
@Table(name = "coupon")
@ApiModel("优惠券")
@Accessors(chain = true)
@ExcelIgnoreUnannotated
@ColumnWidth(18)
public class CouponApiEntity extends PageInfoDto {
    private static final long serialVersionUID = 1L; //一会就说这个是做什么的

    // id dataType:bigint
    @ApiModelProperty(name = "")
    @ExcelProperty("id")
    @Column(name = "id")
    @Id
    @JsonFormat(shape= JsonFormat.Shape.STRING)
    @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "Mysql")
    Long id;

    // 批次 dataType:varchar
    @ApiModelProperty(name = "批次")
    @ExcelProperty("批次")
    @Column(name = "batch_no")
    String batchNo;

    // 优惠券名称 dataType:varchar
    @ApiModelProperty(name = "优惠券名称")
    @ExcelProperty("优惠券名称")
    @Column(name = "name")
    String name;

    // 数量 dataType:int
    @ApiModelProperty(name = "数量")
    @ExcelProperty("数量")
    @Column(name = "qty")
    Integer qty;

    // 类型 100 满xx元，打xx折  101 无门槛，打xx折 200 满xx元，减xx元  201 无门槛，减xx元  dataType:int
    @ApiModelProperty(name = "类型 100 满xx元，打xx折  101 无门槛，打xx折 200 满xx元，减xx元  201 无门槛，减xx元 ")
    @ExcelProperty("类型 100 满xx元，打xx折  101 无门槛，打xx折 200 满xx元，减xx元  201 无门槛，减xx元 ")
    @Column(name = "type")
    Integer type;

    // 0为固定日期 >0为相对有效期 dataType:int
    @ApiModelProperty(name = "0为固定日期 >0为相对有效期")
    @ExcelProperty("0为固定日期 >0为相对有效期")
    @Column(name = "valid_days")
    Integer validDays;

    // fix_day dataType:date
    @ApiModelProperty(name = "")
    @ExcelProperty("fix_day")
    @Column(name = "fix_day")
    Date fixDay;

    // 应用范围 dataType:varchar
    @ApiModelProperty(name = "应用范围")
    @ExcelProperty("应用范围")
    @Column(name = "apply_range")
    String applyRange;

    // 应用主体 dataType:varchar
    @ApiModelProperty(name = "应用主体")
    @ExcelProperty("应用主体")
    @Column(name = "apply_subject")
    String applySubject;

    // 满足 dataType:decimal
    @ApiModelProperty(name = "满足")
    @ExcelProperty("满足")
    @Column(name = "meet")
    BigDecimal meet;

    // 折扣 dataType:decimal
    @ApiModelProperty(name = "折扣")
    @ExcelProperty("折扣")
    @Column(name = "discount")
    BigDecimal discount;

    // 上限 dataType:decimal
    @ApiModelProperty(name = "上限")
    @ExcelProperty("上限")
    @Column(name = "upper")
    BigDecimal upper;

    // create_by dataType:bigint
    @ApiModelProperty(name = "")
    @ExcelProperty("create_by")
    @Column(name = "create_by")
    Long createBy;

    // create_at dataType:datetime
    @ApiModelProperty(name = "")
    @ExcelProperty("create_at")
    @Column(name = "create_at")
    Date createAt;


}